package com.cndcare.msc.netty.controller;

import com.cndcare.msc.config.MyWebSocket;
import com.cndcare.msc.config.SocketMsg;
import com.cndcare.msc.util.SpringBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/socket")
public class SocketContrller {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @RequestMapping("/index")
    public String index() {

        return "socket/index";
    }

    @RequestMapping("/test")
    @ResponseBody
    public String test() {
        RedisTemplate redisTemplate = SpringBeanFactory.getBean("redisTemplate", RedisTemplate.class);
        return "test";
    }

}
